<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:r="http://richfaces.org/rich" xmlns:a="http://richfaces.org/a4j" 
	xmlns:ad="http://agiledev.com.br/fieldset">

	<ad:fieldset legenda="#{messages.associacao}" rendered="#{not empty releasePlanMB.release and not empty releasePlanMB.release.oid}">			
						
		<s:div>
			<s:div style="float: left; width: 61%">
				<r:listShuttle id="lsItemProduct" var="backlog" 
					sourceValue="#{fonte}" targetValue="#{alvo}" 
					sourceCaptionLabel="#{messages.productBacklog}"
					targetCaptionLabel="#{messages.releaseBacklog}"
					converter="itemProductConverter"
					fastOrderControlsVisible="false"
					orderControlsVisible="false"
					fastMoveControlsVisible="false"
					moveControlsVisible="false"
					sourceListWidth="350"
					targetListWidth="350"
					listsHeight="400" >

					<r:column width="200">
						<f:facet name="header">
							<h:outputText value="#{messages.nome}" />
						</f:facet>
						
						<h:outputText value="#{backlog.item.nome}" />
					</r:column>
	
					<r:column width="50">
						<f:facet name="header">
							<h:outputText value="#{messages.prioridade}" />
						</f:facet>
						
						<ui:include src="/pages/item/prioridade.xhtml">
							<ui:param name="valor" value="#{backlog.item.prioridade}" />
						</ui:include>
					</r:column>

					<r:column width="50">
						<f:facet name="header">
							<h:outputText value="#{messages.estimativa}" />
						</f:facet>
						
						<h:outputText value="#{backlog.item.estimativa}"/>
					</r:column>
					
					<a:support event="onlistchanged" ajaxSingle="true" actionListener="#{releasePlanMB.alterarAssociacao}" reRender="plEstimativa" oncomplete="hl();"/>
					
				</r:listShuttle>	
	
			</s:div>

			<s:div style="float: right; width: 39%; margin-top: 20px;">
			
				<ad:fieldset id="plEstimativa" legenda="#{messages.estimativa}">
					
					<r:effect name="hl" for="releasePlanForm:plEstimativa_fieldset" type="Highlight" params="duration:0.8" />
					
					<s:decorate template="/layout/display.xhtml">
						<ui:define name="label">
							<h:outputText value="#{messages.total}" />
						</ui:define>
						
						<h:outputText value="#{releasePlanMB.estimativaProductTotal}">
							<f:convertNumber maxFractionDigits="1"/>
						</h:outputText>
					</s:decorate>

					<s:decorate template="/layout/display.xhtml">
						<ui:define name="label">
							<h:outputText value="#{messages.associado}" />
						</ui:define>
						
						<h:outputText value="#{releasePlanMB.estimativaProductTotal - releasePlanMB.estimativaProductNaoAssociado}">
							<f:convertNumber maxFractionDigits="1"/>
						</h:outputText>
					</s:decorate>
											
					<s:decorate template="/layout/display.xhtml">
						<ui:define name="label">
							<h:outputText value="#{messages.naoAssociado}" />
						</ui:define>
						
						<h:outputText value="#{releasePlanMB.estimativaProductNaoAssociado}">
							<f:convertNumber maxFractionDigits="1"/>
						</h:outputText>						
					</s:decorate>

					<s:decorate template="/layout/display.xhtml">
						<ui:define name="label">
							<h:outputText value="#{messages.associadoRelease}" />
						</ui:define>
						
						<h:outputText value="#{releasePlanMB.estimativaRelease}" styleClass="destaque">
							<f:convertNumber maxFractionDigits="1"/>
						</h:outputText>						
					</s:decorate>							
				</ad:fieldset>
			
			</s:div>
		</s:div>				

	</ad:fieldset>

</ui:composition>